/*
 * This is written by Lulu Han.
 * E-mail: locomotive_crypto@163.com
 */

// Secure Square Euclidean Distance
#ifndef PPSPD_SEC_SSED_H
#define PPSPD_SEC_SSED_H

#include <vector>
#include "sec_mul.h"

class SecSed{
public:
	class CloudA{
	public:
		CloudA(const PrivateKey& pri);
		
		void dec_reenc(const std::vector<NTL::ZZ>& ncva, const std::vector<NTL::ZZ>& ncvb, 
			std::vector<NTL::ZZ>& cvmul);
	private:
		SecMul::CloudA m_a1;
		SecMul::CloudA m_a2;
	};
	
	class CloudB{
	public:
		CloudB(const PublicKey& pub);
		
		void gen_two_ciphers(const std::vector<NTL::ZZ>& cva, const std::vector<NTL::ZZ>& cvb,
			std::vector<NTL::ZZ>& ncva, std::vector<NTL::ZZ>& ncvb);
			
		void gen_mul(const std::vector<NTL::ZZ>& cvmul, NTL::ZZ& csed);
	private:
		SecMul::CloudB m_b1;
		SecMul::CloudB m_b2;
	};
};

#endif // PPSPD_SEC_SSED_H
